class Solution {
public:
    bool canJump(int A[], int n) {
        // Start typing your C/C++ solution below
        // DO NOT write int main() function
		int cur = 0;
		for (int i = 0; i < n; ++i) {
			if (cur < i) {
				return false;
			}
			if (A[i] + i > cur) {
				cur = A[i] + i;
			}
		}
		return true;
    }
};